<?php

namespace plugin\tuCrontabs\app\model;

use support\Model;

/**
 *
 */
class CrontabLogModel extends BaseModel
{
    /**
     * The connection name for the model.
     *
     * @var string|null
     */
//    protected $connection = 'mysql';
    
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'cms_crontab_log';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * 获取 create_time 属性的访问器。
     *
     * @return string
     */
    public function getCreateTimeAttribute($value)
    {
        return date('Y-m-d H:i:s',$value); // 将时间戳格式化为日期时间字符串
    }

    public function getRunningTimeAttribute($value)
    {
        return number_format($value,2).'ms'; // 将时间戳格式化为日期时间字符串
    }

}




















